package com.xbs.entity;

import java.util.List;
/**
 * 分页实体类
 * @author 余凯
 *
 * @param <T>
 */
public class PagesEntity<T> {
	private int currpage;  //当前页
	private int pagesize;  //页大小
	private int total;     //总记录数
	private int pages;	   //总页数
	private List<T> data;  //数据结果
	public PagesEntity() {
		super();
	}
	public PagesEntity(int currpage, int pagesize, int total, List<T> data) {
		super();
		this.currpage = currpage;
		this.pagesize = pagesize;
		this.total = total;
		this.data = data;
		//计算总页数
		this.pages=(total-1)/pagesize+1;
	}
	public int getCurrpage() {
		return currpage;
	}
	public void setCurrpage(int currpage) {
		this.currpage = currpage;
	}
	public int getPagesize() {
		return pagesize;
	}
	public void setPagesize(int pagesize) {
		this.pagesize = pagesize;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getPages() {
		return pages;
	}
	public void setPages(int pages) {
		this.pages = pages;
	}
	public List<T> getData() {
		return data;
	}
	public void setData(List<T> data) {
		this.data = data;
	}
}
